<template>
  <div>
    <el-row :gutter="20">
      <el-col
        :span="12"
      ><div class="grid-content bg-purple">
        <p>日销售统计</p>
        <div class="div_flex">
          <div class="day_flex">
            <span>{{ daynum }}</span>
            <p>当日销售量(个)</p>
          </div>
          <div class="day_flex">
            <span>{{ day }}</span>
            <p>当日销售额(元)</p>
          </div>
          <div class="day_flex">
            <span>{{ daynumsum }}</span>
            <p>当日分成(元)</p>
          </div>
        </div>
      </div>
      </el-col>
      <el-col
        :span="12"
      ><div class="grid-content grid_olor">
        <p>月销售统计</p>
        <div class="div_flex">
          <div class="day_flex">
            <span>{{ infomountcount }}</span>
            <p>当月销售量(个)</p>
          </div>
          <div class="day_flex">
            <span>{{ infoamount/100 }}</span>
            <p>当月销售量(个)</p>
          </div>
          <div class="day_flex">
            <span>{{ infotalbill/100 }}</span>
            <p>当月分成(元)</p>
          </div>
        </div>
      </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { getorderAmount, getorderCount, gettotalBill } from '@/api/statistics'
import { getToday } from '@/utils/date'
export default {
  name: '',
  props: {
    infomountcount: {
      type: Number,
      default: 0
    },
    infoamount: {
      type: Number,
      default: 0
    },
    infotalbill: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      day: 0,
      daynum: 0,
      daynumsum: 0
    }
  },
  created() {
    this.getorderAmount()
  },
  methods: {
    async getorderAmount() {
      this.day = await getorderAmount(getToday())
      this.daynum = await getorderCount(getToday())
      this.daynumsum = await gettotalBill(getToday())
    }
  }

}
</script>

<style scoped lang="scss">
.el-row {
  margin-bottom: 20px;
  &:last-child {
    margin-bottom: 0;
  }
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #e9f3ff;
}
.grid_olor {
  background-color: #fbefe8;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  padding: 10px;
  border-radius: 4px;
  min-height: 166px;
  width: 600px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
.div_flex {
  display: flex;
  justify-content: space-evenly;
  text-align: center;
  span {
    color: #072074;
    text-shadow: 2px 4px 7px rgba(85, 132, 255, 0.5);
    font-size: 36px;
    font-weight: 600;
  }
  p {
    color: #91a7dc;
    font-size: 12px;
    margin-left: 50px;
  }
}
.grid_olor {
  span {
    color: #ff5757;
    text-shadow: 2px 4px 7px rgba(255,99,85,.5);
  }
  p{
    color: #de9690;
  }
}
</style>
